unit uIO;
interface
uses SDLh;
{$INCLUDE options.inc}

const ipcPort: Word = 0;

procedure SendIPC(s: shortstring);
procedure SendIPCXY(cmd: char; X, Y: SmallInt);
procedure SendIPCRaw(p: pointer; len: Longword);
procedure SendIPCAndWaitReply(s: shortstring);
procedure SendIPCTimeInc;
procedure LoadRecordFromFile(fileName: shortstring);
procedure IPCWaitPongEvent;
procedure IPCCheckSock;
procedure InitIPC;
procedure CloseIPC;
procedure NetGetNextCmd;

var hiTicks: Word = 0;

implementation
uses uConsole, uConsts, uWorld, uMisc, uLand, uChat, uTeams;
const isPonged: boolean = false;

type PCmd = ^TCmd;
	 TCmd = packed record
			Next: PCmd;
			Time: LongWord;
			case byte of
			1: (len: byte;
				cmd: Char;
				X, Y: SmallInt);
			2: (str: shortstring);
			end;
			
var  IPCSock: PTCPSocket = nil;
	 fds: PSDLNet_SocketSet;
	 
	 headcmd: PCmd = nil;
	 lastcmd: PCmd = nil;
	 
function AddCmd(Time: Longword; str: shortstring): PCmd;
var Result: PCmd;
begin
end;
